package com.ning.common.config;

import com.ning.common.web.interceptor.JwtInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MvcConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 1.先走拦截器 2.jwt再从容器中取
        registry.addInterceptor(new JwtInterceptor())
                .addPathPatterns("/config/**");
    }
}
